package main

import "fmt"

func main() {
	fmt.Println(recursion(5))
	fmt.Println(forLoop(5))
}

func forLoop(n int) int {
	if n == 0{
		return 0
	}else if n==1{
		return 1
	}
	m,a,b:=0,1,0
	for m<n {
		a,b=b,a+b
		m++
	}
	return a
}

func recursion(n int) int {
	if n == 1{
		return 0
	}else if n==2{
		return 1
	}
	return recursion(n-1) + recursion(n-2)
}
